<script language=php>
	include("mysql_connect.php");
	
	$strSqlCommand = "SELECT FirstName, LastName FROM Agent";
	
//	if(strlen($strKeyWord) > 0)
//		$strSqlCommand .= " WHERE FirstName LIKE '%".$strKeyWord."%' OR LastName LIKE '%".$strKeyWord."%'";
	
	$strSqlCommand .= " ORDER BY LastName";
	
	$result = mysql_query($strSqlCommand);

	//$ArrayAgent = array("Kevin Adams","Amelia Ahne","Sabastion Battaglia","Harold Cannily");
	
//	echo '<li data-role="list-divider" role="heading">A</li>';
	//foreach($ArrayAgent as $strName)
	$Divider = "0";
	//$nIdx = 0;
	//$nRowNum = @mysql_num_rows($result);
	while($rowMedia = @mysql_fetch_row($result))	
	{
		//$nIdx++;
		if(strncmp( $rowMedia[1], $Divider, 1) != 0)
		{
			//if(strcmp($Divider,"0")==0)
			//{
			//	echo '<li class="ui-li ui-li-divider ui-bar-b ui-corner-top" data-role="list-divider" role="heading" data-theme="b" data-inset="true">';
			//}
			//else
			//{
				echo '<li data-role="list-divider" role="heading">';
			//}
			$Divider = substr($rowMedia[1],0,1);
			
			echo $Divider;
			echo '</li>';		
		}
//		if($nIdx == $nRowNum)
//		{
//			echo '<li class="ui-btn ui-btn-icon-right ui-li-has-arrow ui-li ui-li ui-corner-bottom ui-btn-up-c" 
//					data-theme="c" data-corners="false" data-shadow="false" data-iconshadow="true" data-iconsize="18" 
//					data-wrapperels="div" data-icon="arrow-r" data-iconpos="right">';
//		}
//		else
//		{
			echo '<li data-theme="c">';// data-corners="false" data-shadow="false" data-iconshadow="true" data-iconsize="18" 
//					data-wrapperels="div" data-icon="arrow-r" data-iconpos="right">';
//		}
//		echo '<div class="ui-btn-inner ui-li">';
//		echo '<div class="ui-btn-text">';
		echo '<a href="#page6" data-transition="slide">';//class="ui-link-inherit"
		echo $rowMedia[0].' '.$rowMedia[1];
		echo '</a>';
//		echo '</div>';
//		echo '<span class="ui-icon ui-icon-arrow-r ui-icon-shadow ui-iconsize-18">&nbsp;</span>';
//		echo '</div>';
		echo '</li>';
	}
</script>>
